Skip to content

Conversation

@mglaman
Copy link
Contributor

@mglaman mglaman commented Nov 7, 2025

Summary

This PR consolidates the separate BuildDockerImage.yml and PublishDockerImage.yml workflows into a single DockerImage.yml workflow with intelligent conditional logic.

Changes

  • Consolidated workflows: Merged two separate workflow files into one
  • Fork-safe logic: Added github.event.repository.fork == false check to prevent push failures on forks
  • Conditional operations: Login, push, and attestation steps only run when appropriate
  • Maintained functionality: All existing behavior preserved for PRs, main branch, and tag pushes

Benefits

  • DRY principle: Single workflow to maintain instead of two
  • No fork failures: Contributors can test changes on forks without authentication errors
  • Resource efficient: No unnecessary registry operations on PRs or forks
  • Consistent builds: Same build process validates all changes

Test plan

  • Test PR from fork (should build but not push)
  • Test PR from original repo (should build but not push)
  • Test push to main branch (should build and push)
  • Test tag push (should build and push with proper semver tags)

🤖 Generated with Claude Code

Combines BuildDockerImage.yml and PublishDockerImage.yml into a single
DockerImage.yml workflow that:

- Builds images for all events (PRs, main pushes, tag pushes)
- Only pushes to registry on main branch or tags in the original repository
- Prevents login/push failures on forks using github.event.repository.fork check
- Maintains all existing functionality while reducing duplication

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants